package com.project.controller;

import com.project.bean.PieBean;
import com.project.service.IPieService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

@RestController
@RequestMapping("pie")
@Api(tags = "饼图")
public class PieController {
    @Autowired
    private IPieService service;
    @ApiOperation(value = "统计每个类别的销售总金额")
    @RequestMapping("getByType")
    public List<PieBean> getByType(LocalDate startDate, LocalDate endDate){
        return service.getByType(startDate, endDate);
    }
    @ApiOperation(value = "统计每个类别每个品牌销售总金额")
    @RequestMapping("getByName")
    public List<PieBean> getByName(LocalDate startDate, LocalDate endDate){
        return service.getByName(startDate, endDate);
    }
}
